Explain with example basic components of Use case scenario (diagram) β (a) Actor, (b) Use case and (c) System boundary.
Basic Components of Use Case Diagramsβ
Use case diagrams are a key modeling technique in UML (Unified Modeling Language) that visually represent the interactions between users (actors) and a system. They help in understanding and capturing the functional requirements of a system from an external perspective.
1. Actorβ
An actor represents an entity that interacts with the system but is external to the system itself. Actors can be human users, other systems, or external devices that exchange information with the system.
Characteristics of Actors:β
- Represented by a stick figure in UML notation
- Named using nouns (e.g., "Customer," "Administrator," "Payment System")
- Can be primary (initiates the use case) or secondary (participates in the use case but doesn't initiate it)
- May have generalizations (e.g., "User" could be generalized to "Registered User" and "Guest User")
Examples of Actors:β
- In a banking system: Customer, Bank Teller, Bank Manager, ATM Machine, Credit Card System
- In an e-commerce application: Shopper, Administrator, Payment Gateway, Shipping Service
2. Use Caseβ
A use case represents a specific functionality or service that the system provides to its actors. It describes a sequence of actions that provides something of measurable value to an actor.
Characteristics of Use Cases:β
- Represented by an oval or ellipse in UML notation
- Named using verb phrases (e.g., "Place Order," "Withdraw Cash," "Generate Report")
- Describes what the system does, not how it does it
- Focuses on user goals and visible behavior of the system
Examples of Use Cases:β
- In a banking system: "Withdraw Cash," "Deposit Check," "Transfer Funds," "Check Balance"
- In an e-commerce application: "Browse Products," "Add to Cart," "Checkout," "Track Order"
3. System Boundaryβ
The system boundary defines the scope of the system being modeled. It separates what is inside the system (use cases) from what is outside (actors).
Characteristics of System Boundary:β
- Represented by a rectangle that encloses all the use cases
- Usually labeled with the name of the system at the top
- Actors are placed outside the boundary
- Helps to clarify the scope of the system under development
Example Use Case Diagram: Online Shopping Systemβ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Online Shopping System β
β β
β βββββββββββββββββ βββββββββββββββββ β
β β β β β β
β β Browse β β Register β β
β β Products β β Account β β
β β β β β β
β βββββββββββββββββ βββββββββββββββββ β
β β² β² β
β β β β
ββββββββββββββΌβββββββββββββββββββββββββΌββββββββββββββ
β β
ββββ΄ββββ ββββ΄ββββ
β β β β
β β β β
βββββββ΄βββββββ βββββββ΄ββββββ
β Customer ββ β Guest β
ββββββββββββββ βββββββββββββ
β
β
βββββββ΄ββββββ βββββββββββββββββ
β β β Payment β
β Admin βββββββββΊ Gateway β
β β β β
βββββββββββββ βββββββββββββββββ
In this example:
Actors:
- Customer: A registered user who can browse products and make purchases
- Guest: An unregistered user who can only browse products
- Admin: System administrator who manages the system
- Payment Gateway: External system that processes payments
Use Cases:
- Browse Products: Allows users to view available products
- Register Account: Allows guests to create a new account
System Boundary:
- The rectangle labeled "Online Shopping System" that encloses the use cases
Relationships in Use Case Diagramsβ
In addition to the basic components, use case diagrams can show relationships:
- Association: Connects actors to use cases (shown as lines)
- Include: Indicates that one use case includes the functionality of another (shown as a dashed arrow with Β«includeΒ»)
- Extend: Indicates that one use case may be extended by another under certain conditions (shown as a dashed arrow with Β«extendΒ»)
- Generalization: Indicates that one actor or use case is a specialized form of another (shown as a solid line with a hollow arrowhead)
Use case diagrams are valuable tools for capturing and communicating the functional requirements of a system in a way that is understandable to both technical and non-technical stakeholders.